Copy placer data when in waypt_dupe.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 1 Jul 2005 05:53:53 +0000 (05:53 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 1 Jul 2005 05:53:53 +0000 (05:53 +0000)
gpsbabel/waypt.c

index ee8b433553dcb14a037275aa5e1922dd47c265f4..87731cd6678923097e87fa5bd1b6aaa898aa0766 100644 (file)
@@ -36,6 +36,9 @@ waypt_init(void)
 waypoint *
 waypt_dupe(const waypoint *wpt) 
 {
+       /*
+        * This and waypt_free should be closely synced.
+        */
        waypoint * tmp;
        tmp = waypt_new();
        memcpy(tmp, wpt, sizeof(waypoint));
@@ -60,6 +63,10 @@ waypt_dupe(const waypoint *wpt)
                tmp->gc_data.desc_long.utfstring = 
                        xstrdup(tmp->gc_data.desc_long.utfstring);
        }
+       if (wpt->gc_data.placer) {
+                tmp->gc_data.placer = xstrdup(wpt->gc_data.placer);
+        }
+
        /*
         * It's important that this duplicated waypoint not appear
         * on the master Q.
@@ -249,6 +256,9 @@ find_waypt_by_name(const char *name)
 void 
 waypt_free( waypoint *wpt )
 {
+       /*
+        * This and waypt_dupe should be closely synced.
+        */
        if (wpt->shortname) {
                xfree(wpt->shortname);
        }